package com.situ.week1.day1.cal;

import org.junit.Test;

public class CalDemo {
    public static void main(String[] args) {
        Add add = new Add(3, 5);
        int result1 = add.getResult();
        System.out.println(result1);

        Sub sub = new Sub();
        sub.setNum1(3);
        sub.setNum2(5);
        int result2 = sub.getResult();
        System.out.println(result2);
    }
    @Test
    public void test1() {
        Add add = new Add(3, 2);
        int result1 = add.getResult();
        System.out.println(result1);

        Cal cal = new Add(3, 2);
        int result2 = cal.getResult();
        System.out.println(result2);

        cal = new Sub(3, 2);
        int result3 = cal.getResult();
        System.out.println(result3);
    }

    @Test
    public void test2() {
        Cal cal = new Div(3, 2);
        int result = cal.getResult();
        System.out.println(result);

    }

    public void jisuan(Cal cal) {
        cal.getResult();
    }
}
